# from urllib.parse import urlencode, parse_qs
# from urllib.request import urlopen
# from django.test import TestCase
# from itsdangerous import TimedJSONWebSignatureSerializer as TJWSerializer
# # # Create your tests here.
#
# # if __name__ == '__main__':
# #     #签名加密
# #     data = {
# #         'openid' : 'KEKKELSD183883LDKDK1002D'
# #     }
# #
# #     serializer = TJWSerializer(secret_key='abc123', expires_in=600)
# #
# #     token = serializer.dumps(data)
# #     print(token)
#
#
# if __name__ == '__main__':
#     # 解密
#     req_data = 'eyJleHAiOjE1NTIxMzk5NzAsImlhdCI6MTU1MjEzOTM3MCwiYWxnIjoiSFM1MTIifQ.eyJvcGVuaWQiOiJLRUtLRUxTRDE4Mzg4M0xES0RLMTAwMkQifQ.K6fFS-rYW7o8LUT6f-i3E0rAx_lBaGPBE32qwl6WTVK_Lz7JscvfOQSafGXQOzBRzZl9_dJ0uVYigvBZGtOBDA'
#     serializer = TJWSerializer(secret_key="abc123")
#
#     res = serializer.loads(req_data)
#     print(res)
#
#
#
#
# # if __name__ == '__main__':
# #     # urlopen(req_url),发起http请求
# #     req_url = "http://api.meiduo.site:8000/mobiles/13155667788/count/"
#
#     # 发起http请求，获取响应
#     # response = urlopen(req_url)
#     #
#     # # 获取响应的数据
#     # res_data = response.read()
#     # print(res_data)
#     #
#     # res_data = res_data.decode()
#     # print(res_data)
#
#
#
# # if __name__ == '__main__':
# #     req_date = {
# #         "a" : 1,
# #         "b" : 2,
# #         "c" : 3
# #     }
# #
# #     # a=1&b=2&c=3
# #     '''字典转为查询字符串'''
# #     res = urlencode(req_date)
# #     print(res)
#
# #
# # if __name__ == '__main__':
# #     qs_str = "a=1&b=2&c=3"
# #
# #     res = parse_qs(qs_str)
# #     print(res)
# #     print(res['a'][0])